org.eclipse.vtp.framework.engine.runtime
Class Service

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.runtime.Component
      extended by org.eclipse.vtp.framework.engine.runtime.Configurable
          extended by org.eclipse.vtp.framework.engine.runtime.Service

public class Service
extends Configurable

Represents a service available to actions and observers.

Author:
Lonnie Pryor

Field Summary
 
Fields inherited from class org.eclipse.vtp.framework.engine.runtime.Component
blueprint, constructors, mutators
 
Constructor Summary
Service(Blueprint blueprint, org.w3c.dom.Element[] configurations, ServiceDescriptor descriptor)
          Creates a new Service.
 
Method Summary
protected  IContext createServiceRegistry(Scope scope)
          Creates a service registry for the specified scope.
protected  java.lang.Class getComponentType()
           
 java.lang.String getDescriptorID()
          Returns the ID of the descriptor this service is based on.
 java.util.Set getIdentifiers()
          Returns the identifiers of this service.
 java.lang.Object getInstance(Scope scope)
           
protected  java.lang.Object[] lookupAllSiblingServices(java.lang.String identifier, Scope scope)
          Looks up all services with the specified identifier in the supplied scope or null if said identifier is also present on this service or no such service exists.
protected  java.lang.Object lookupSiblingService(java.lang.String identifier, Scope scope)
          Looks up a service with the specified identifier in the supplied scope or null if said identifier is also present on this service or no such service exists.
 
Methods inherited from class org.eclipse.vtp.framework.engine.runtime.Configurable
createBuilder, lookupAllConfigurations, lookupConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

public Service(Blueprint blueprint,
               org.w3c.dom.Element[] configurations,
               ServiceDescriptor descriptor)
        throws java.lang.NullPointerException
Creates a new Service.

Parameters:
blueprint - The blueprint of the process.
elements - The configuration data or null for no configuration data.
descriptor -
Throws:
java.lang.NullPointerException - If the supplied blueprint is null.
java.lang.NullPointerException - If the supplied descriptor is null.
Method Detail

getDescriptorID

public java.lang.String getDescriptorID()
Returns the ID of the descriptor this service is based on.

Returns:
The ID of the descriptor this service is based on.

getIdentifiers

public java.util.Set getIdentifiers()
Returns the identifiers of this service.

Returns:
The identifiers of this service.

lookupSiblingService

protected java.lang.Object lookupSiblingService(java.lang.String identifier,
                                                Scope scope)
Looks up a service with the specified identifier in the supplied scope or null if said identifier is also present on this service or no such service exists.

Parameters:
identifier - The identifier of the service to look up.
scope - The scope to search for a sibling service in.
Returns:
A service with the specified identifier in the supplied scope or null if said identifier is also present on this service or no such service exists.

lookupAllSiblingServices

protected java.lang.Object[] lookupAllSiblingServices(java.lang.String identifier,
                                                      Scope scope)
Looks up all services with the specified identifier in the supplied scope or null if said identifier is also present on this service or no such service exists.

Parameters:
identifier - The identifier of the services to look up.
scope - The scope to search for sibling services in.
Returns:
All services with the specified identifier in the supplied scope or null if said identifier is also present on this service or no such service exists.

getComponentType

protected java.lang.Class getComponentType()

createServiceRegistry

protected IContext createServiceRegistry(Scope scope)
Description copied from class: Configurable
Creates a service registry for the specified scope.

Specified by:
createServiceRegistry in class Configurable
Parameters:
scope - The scope to create the registry for.
Returns:
A new service registry for the specified scope.

getInstance

public java.lang.Object getInstance(Scope scope)
                             throws java.lang.IllegalStateException,
                                    java.lang.NullPointerException
Throws:
java.lang.IllegalStateException
java.lang.NullPointerException